﻿
/****************************************************************************
   CONFIDENTIAL AND PROPRIETARY INFORMATION.
   Copyright © 2011. Cody Nguyen [cody.haind@gmail.com].  All Rights Reserved.
 ****************************************************************************/

package
{
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	import com.greensock.*;
	import com.greensock.easing.*;
	import com.hybrid.ui.ToolTip;
	
	import fl.transitions.*;
	import fl.transitions.easing.*;
	
	import flash.display.*;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.events.MouseEvent;
	import flash.filters.*;
	import flash.media.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	import flashx.textLayout.accessibility.TextAccImpl;

	public class Prison extends MovieClip
	{
		var face_book_url:String = "https://www.facebook.com/CaptainsOfLives";
		var News:MovieClip;
		public var face_book_mc:news;
        public var myXML:XML;
        public var url_source:String;
        public var arr_time:Array;
        public var arr_mess:Array;
		private var arr_url:Array = [];
        public var loader:Object;
        public var counter:Number;
        public var myTimer:Timer;
		public function Prison()
		{
			
			//var mainSoundClick:clickTwo = new clickTwo();
			
			// Create a new instance of the Font1 symbol from the document's library.
			var myFont:Font = new HelveticaNeue();
			/* Create a new TextFormat object, and set the font property to the myFont
			 object's fontName property. */
			var myFormat:TextFormat = new TextFormat();
			myFormat.font = myFont.fontName;
			myFormat.size = 16;
			myFormat.color = 0xffffff;
			var text_shadow:DropShadowFilter = new DropShadowFilter;
			text_shadow.blurX = 2;
			text_shadow.blurY = 2;
			text_shadow.alpha = .75;
			text_shadow.distance = 2;
			text_shadow.angle = 45;
			
			var tf:TextFormat = new TextFormat();
			tf.font = myFont.fontName;
			tf.size = 12;
			tf.bold = true;
			tf.color = 0xffffff;
			var ttl:ToolTip = new ToolTip();
			var ttr:ToolTip = new ToolTip();
			ttl.hook = ttr.hook = true;
			ttl.cornerRadius = ttr.cornerRadius = 1;
			ttl.titleFormat = ttr.titleFormat = tf;
			ttl.titleEmbed = ttr.titleEmbed = true;
			ttl.align = ttr.align = "center";
			ttl.colors = ttr.colors = [ "0x0cd5ff", "0x0cd5ff" ];
			ttl.border = ttr.border = 0xffffff;
			ttl.borderSize = ttr.borderSize = 1;
			ttl.paddingH = ttr.paddingH = 8;
			ttl.hookDirection = "left";
			ttr.hookDirection = "right";
			ttl.hookSize = ttr.hookSize = 12;
			ttl.buffer = ttr.buffer = 0;
			ttl.autoSize = ttr.autoSize = true;
			
			var keyhole_all_mc:MovieClip = new MovieClip();
			addChild(keyhole_all_mc);
							
			function centerAllIn(arr:Array) {
				for (var i:int = 0; i < arr.length; i++) 
				{
					arr[i].x = 650;
					arr[i].y = 460;
				}
			}
			function enableButtonMode(arr:Array)
			{
				for (var k:int = 0; k < arr.length; k++) 
				{
					arr[k].buttonMode = true;
				}
				
			}
			var topButtons1:Array=["Contacts us","Faq", "Apply now","Testimonials"];
			var itemArray1=new Array();
			//var spaceInBetween1:Number = 2;
			var topButtons:Array = ["About Us", "Prison Officer", "Senior Prison Officer","Civilian Officer", "Rewards","Student Opportunities"];
			var itemArray = new Array();
			var spaceInBetween:Number = 8;
			var topBar_mc:MovieClip = new MovieClip();
			topBar_mc.graphics.drawRect(0, 0, 1300,115);
			addChild(topBar_mc);
			var topBarBg_mc:barTop = new barTop();
			topBar_mc.addChild(topBarBg_mc);
			var logo_mc:logo = new logo();
			logo_mc.x = 47;
			logo_mc.y = 30;
			topBar_mc.addChild(logo_mc);
			logo_mc.buttonMode = true;
			logo_mc.addEventListener(MouseEvent.CLICK,onClicklogo);
			function onClicklogo(e:MouseEvent):void{
				//slide_mc.x=-765;
				showoffices();
				TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
				TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
				TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
				TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
				gotoAndPlay(102);		

			}


			//var topbarSoundHover:clickOne = new clickOne();
			
			for(var i:Number=0; i< topButtons1.length; i++)
			{
				var button1: TextField=new TextField();
				button1.autoSize=TextFieldAutoSize.LEFT;
				button1.defaultTextFormat=myFormat;
				button1.embedFonts=true;
				button1.antiAliasType= AntiAliasType.NORMAL;
				button1.selectable=false;
				button1.text=topButtons1[i].toUpperCase();
				topBar_mc.addChild(button1);
				itemArray1.push(button1);
				if(i>0){
					button1.x=itemArray1[i-1].x + itemArray1[i-1].width + 16;
				}else if(i==0){button1.x=893;}
				if(i<topButtons1.length-1){
					var divider1:TextField = new TextField();
					divider1.autoSize = TextFieldAutoSize.LEFT;
					divider1.defaultTextFormat = myFormat;
					divider1.embedFonts = true;
					divider1.antiAliasType = AntiAliasType.NORMAL;
					divider1.selectable = false;
					divider1.text = "|";
					topBar_mc.addChild(divider1);
					divider1.x = button1.x + button1.width + 5;
					divider1.y = 38;
					divider1.filters = [text_shadow];
				}
				button1.y = 38;
				button1.filters = [text_shadow];
				button1.addEventListener(MouseEvent.MOUSE_OVER, buttonOver1);
				button1.addEventListener(MouseEvent.MOUSE_OUT, buttonOut1);
				button1.addEventListener(MouseEvent.CLICK, onClickButton1);
			}
			function onClickButton1(e:MouseEvent):void{
				if(mouseX>1131&&mouseX<1230){
					//Testimonials
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );
					//TweenLite.to(slide2_mc.of4_mc,.3 ,{ alpha:0} );//
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:1} );
					gotoAndPlay(111);
					TweenLite.to(slide2_mc,.5 ,{ x:-320,y:-80} );
				}
				if(mouseX>1032&&mouseX<1112){
					//Applynow
					showoffices();
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
					gotoAndPlay(39);
				}
				if(mouseX>876&&mouseX<970){
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );	
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:1} );
					TweenLite.to(slide2_mc,.5 ,{ x:-789.25,y:-80} );
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:258, width:477, height:743});
					gotoAndPlay(224);
					TweenLite.to(slide2_mc,.5 ,{ x:-779.25,y:-80} );
				}
				if(mouseX>987&&mouseX<1015)
				{					
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );	
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:1} );
					TweenLite.to(slide2_mc,.5 ,{ x:-789.25,y:-80} );
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:258, width:477, height:743});
					gotoAndPlay(199);
				}
			
			}
			function buttonOver1(event:MouseEvent):void {
				event.target.filters = [text_shadow];
				TweenMax.to(event.target, 0.4, {hexColors:{textColor:0x0cdaff},
					dropShadowFilter: {color:0x000000, alpha:1, blurX:2, blurY:2, distance:5}
				});
				Mouse.cursor="button";
				trace(mouseX);
			}
			function buttonOut1(event:MouseEvent):void {
				event.target.filters = [text_shadow];
				TweenMax.to(event.target, 1, {hexColors:{textColor:0xffffff},
					dropShadowFilter: {color:0x000000, alpha:1, blurX:2, blurY:2, distance:2}
				});
				Mouse.cursor="auto";
			}
			for (var i1:Number = 0; i1< topButtons.length; i1++) {
				
				var button:TextField = new TextField();
				button.autoSize = TextFieldAutoSize.LEFT;
				button.defaultTextFormat = myFormat;
				button.embedFonts = true;
				button.antiAliasType = AntiAliasType.NORMAL;
				button.selectable = false;
				button.text = topButtons[i1].toUpperCase();
				topBar_mc.addChild(button);
				itemArray.push(button);
				if (i1 > 0) {
					button.x = itemArray[i1-1].x + itemArray[i1-1].width + 16;
				} else if (i1 == 0) {
					button.x = 476;
				}
				if (i1 < topButtons.length - 1) {
					var divider:TextField = new TextField();
					divider.autoSize = TextFieldAutoSize.LEFT;
					divider.defaultTextFormat = myFormat;
					divider.embedFonts = true;
					divider.antiAliasType = AntiAliasType.NORMAL;
					divider.selectable = false;
					divider.text = "|";
					topBar_mc.addChild(divider);
					divider.x = button.x + button.width + 5;
					divider.y = 68;
					divider.filters = [text_shadow];
				}
				button.y = 68;
				button.filters = [text_shadow];
				button.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
				button.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
				button.addEventListener(MouseEvent.CLICK, onClickButton);
			}
			
			function onClickButton(e:MouseEvent):void{
				
				if(mouseX>445&&mouseX<514)
				{
					//About Us
				showoffices();
				TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
				TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
				TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
				TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
				gotoAndPlay(46);
				}
				if(mouseX>531&&mouseX<641)
				{
					//Prison Officer
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					//TweenLite.to(slide2_mc.of4_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:1} );
					TweenLite.to(slide2_mc,.5 ,{ x:-930,y:-80} );
					TweenLite.to(slide2_mc.of3_mc, .5, {y:262, width:324.25, height:763.1});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
					gotoAndPlay(133);
				}
				if(mouseX>659&&mouseX<823){
//					Senior Prison Officer
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
	//TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:1} );
					TweenLite.to(slide2_mc,.5 ,{ x:-650,y:-80} );
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:266, width:291.85, height:731.95});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
					gotoAndPlay(163);
					
				}				
				if(mouseX>841&&mouseX<959){
					//Civilian Office
					showoffices();
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
					gotoAndPlay(58);
				}
				if(mouseX>976&&mouseX<1045){
					//Rewards
					showoffices();
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});
					gotoAndPlay(18);
				}
				if(mouseX>1064&&mouseX<1232){
					//Sutdent Opportunities
					TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );	
					TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:0} );
					TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:1} );
					TweenLite.to(slide2_mc,.5 ,{ x:-483.7,y:-80} );
					TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
					TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
					TweenLite.to(slide2_mc.of5_mc, .5, {y:258, width:346.3, height:741});
					TweenLite.to(slide2_mc.of6_mc, .5, {y:402, width:384, height:598});

					gotoAndPlay(180);
					
				}
													
			}
			function buttonOver(event:MouseEvent):void {
				event.target.filters = [text_shadow];
				TweenMax.to(event.target, 0.4, {hexColors:{textColor:0x0cdaff},
					dropShadowFilter: {color:0x000000, alpha:1, blurX:2, blurY:2, distance:5}
				});
				Mouse.cursor="button";
				trace(mouseX);
			}
			function buttonOut(event:MouseEvent):void {
				event.target.filters = [text_shadow];
				TweenMax.to(event.target, 1, {hexColors:{textColor:0xffffff},
					dropShadowFilter: {color:0x000000, alpha:1, blurX:2, blurY:2, distance:2}
				});
				Mouse.cursor="auto";
			}
			
			// Bottom bar
			var bottom_holder_mc:MovieClip = new MovieClip();
			bottom_holder_mc.graphics.drawRect( 0, 0, 1300, 100 );
			bottom_holder_mc.y = 822;
			addChild( bottom_holder_mc );
			//var transparent_mc:transparent = new transparent();
//			transparent_mc.width = 1300;
//			transparent_mc.height = 128;
//			transparent_mc.x = 650;
//			transparent_mc.y = 64;
//			transparent_mc.alpha = 0;
//			bottom_holder_mc.addChild( transparent_mc );
			var bottomBar_mc:MovieClip = new MovieClip();
			bottomBar_mc.graphics.drawRect( 0, 0, 1300, 100 );
			bottomBar_mc.y = 0;
			bottom_holder_mc.addChild( bottomBar_mc );
			
			var bottom_bar_bg_mc:barBottom = new barBottom();
			bottomBar_mc.addChild( bottom_bar_bg_mc );
			var faceb = new Loader();
			addChild( faceb);
			faceb.load(new URLRequest("image/face.png"));
			faceb.x = 948;
			faceb.y = 842.5;
			var face1=new Loader();
			addChild (face1);
			face1.load(new URLRequest("image/face1.png"));
			face1.alpha=0;
			face1.x=948;
			face1.y=842.5;
			face1.addEventListener( MouseEvent.MOUSE_OVER, dummyOver );
			face1.addEventListener( MouseEvent.MOUSE_OUT, dummyOut );
			face1.addEventListener( MouseEvent.CLICK, navFaceBook );
			
			function dummyOver( event:MouseEvent ):void
			{
					Mouse.cursor = "button";
					ttr.show( face1, "FIND US ON FACEBOOK" );
					TweenLite.to(face1,.5,{alpha:1});
			}
			function dummyOut( event:MouseEvent ):void
			{
				TweenLite.to(face1,.5,{alpha:0});
				Mouse.cursor = "auto";
			}
			var faq2=new Loader();
			addChild(faq2);
			faq2.load(new URLRequest("image/faq2.png"));
			faq2.x=985;
			faq2.y=842.5;
			var faq=new Loader();
			addChild(faq);
			faq.load(new URLRequest("image/faq.png"));
			faq.x=985;
			faq.y=842.5;
			faq.alpha=0;
			faq.addEventListener( MouseEvent.MOUSE_OVER, faqOver );
			faq.addEventListener( MouseEvent.MOUSE_OUT, faqOut );
			faq.addEventListener( MouseEvent.CLICK, faqOutclick );
			function faqOutclick(e:MouseEvent):void{
				TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );	
				TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:1} );
				TweenLite.to(slide2_mc,.5 ,{ x:-789.25,y:-80} );
				TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
				TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
				TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
				TweenLite.to(slide2_mc.of6_mc, .5, {y:258, width:477, height:743});
				gotoAndPlay(199);
				
			}
			function faqOver( event:MouseEvent ):void{
				Mouse.cursor = "button";
				TweenLite.to(faq, .5, {alpha:1});
					ttr.show( faq, "FAQ" );
			}
			function faqOut( event:MouseEvent ):void
			{
				Mouse.cursor = "auto";
				TweenLite.to(faq, .5, {alpha:0});
			}
			var contact2=new Loader();
			addChild(contact2);
			contact2.load(new URLRequest("image/contact2.png"));
			contact2.x=1020;
			contact2.y=842.5;
			var contact=new Loader();
			addChild(contact);
			contact.load(new URLRequest("image/contact.png"));
			contact.x=1020;
			contact.y=842.5;
			contact.alpha=0;
			contact.addEventListener( MouseEvent.MOUSE_OVER, contactOver );
			contact.addEventListener( MouseEvent.MOUSE_OUT, contactOut );
			contact.addEventListener( MouseEvent.CLICK, contactOutclick );
			function contactOutclick(e:MouseEvent):void{
				TweenLite.to(slide2_mc.of1_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of2_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of3_mc,.3 ,{ alpha:0} );	
				TweenLite.to(slide2_mc.of5_mc,.3 ,{ alpha:0} );
				TweenLite.to(slide2_mc.of6_mc,.3 ,{ alpha:1} );
				TweenLite.to(slide2_mc,.5 ,{ x:-789.25,y:-80} );
				TweenLite.to(slide2_mc.of3_mc, .5, {y:412, width:259, height:588});
				TweenLite.to(slide2_mc.of2_mc, .5, {y:536, width:185, height:464});
				TweenLite.to(slide2_mc.of5_mc, .5, {y:495, width:236, height:505});
				TweenLite.to(slide2_mc.of6_mc, .5, {y:258, width:477, height:743});
				gotoAndPlay(224);
				TweenLite.to(slide2_mc,.5 ,{ x:-779.25,y:-80} );
			}
			function contactOver( event:MouseEvent ):void{
				Mouse.cursor = "button";
					ttr.show( contact, "CONTACT US" );
					TweenLite.to(contact,.5,{alpha:1});
			}
			function contactOut( event:MouseEvent ):void
			{
				Mouse.cursor = "auto";
				TweenLite.to(contact,.5,{alpha:0});
			}
			//var facebook=new Loader();
			//addChild(facebook);
			//facebook.load(new URLRequest("facebook.swf"));
			//facebook.x=-12;
			//facebook.y=826;
			//facebook.addEventListener( MouseEvent.MOUSE_OVER, faceOver );
//			function faceOver( event:MouseEvent ):void{
//				Mouse.cursor = "button";
//					ttr.show( facebook, "FIND US ON FACEBOOK" );
//			}
			
			var captainsOfLife_mc:captainsOfLife = new captainsOfLife();
			bottomBar_mc.addChild( captainsOfLife_mc );
			captainsOfLife_mc.x = 1055;
			captainsOfLife_mc.y = 24;
			bottom_holder_mc.addEventListener( MouseEvent.ROLL_OVER, showBottomBar );
			//bottom_holder_mc.addEventListener( MouseEvent.ROLL_OUT, hideBottomBar );
			function showBottomBar( event:MouseEvent ):void
			{
				TweenLite.to( bottomBar_mc, 0.5, { y: 0, ease: Back.easeOut } );
			
			}
			//function hideBottomBar( event:MouseEvent ):void
//			{
//				TweenLite.to( bottomBar_mc, 0.4, { y: 128, ease: Back.easeIn } );
//			
//			}
			face_book_mc = new news();
			face_book_mc.x=40;
			face_book_mc.y=806;
			face_book_mc.navMc.addEventListener(MouseEvent.CLICK,navFaceBook);
			face_book_mc.navMc.buttonMode = true;
			addChild(face_book_mc);
			loadFaceBookData()
			
		}
		//faceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
		private function navFaceBook(e:MouseEvent):void{
			navigateToURL(new URLRequest(face_book_url));
		}
		 public function xmlLoaded(event:Event) : void
        {
            var _loc_2:XML = null;
            var _loc_3:* = undefined;
            var _loc_4:* = undefined;
            var _loc_5:* = undefined;
            var _loc_6:* = undefined;
            var _loc_7:* = undefined;
            this.loader.removeEventListener(Event.COMPLETE,xmlLoaded);
            if (event.target as URLLoader != null)
            {
                this.myXML = new XML(event.target.data);
                for each (_loc_2 in this.myXML.article)
                {
                    
                    _loc_3 = new Date(_loc_2.createdate * 1000);
                    _loc_4 = _loc_3.getDate().toString();
                    _loc_5 = "";
                    if (++_loc_4 < 10)
                    {
                        _loc_5 = _loc_5 + ("0" + ++_loc_4 + "/");
                    }
                    else
                    {
                        _loc_5 = _loc_5 + (_loc_4 + "/");
                    }
                    _loc_6 = _loc_3.getMonth().toString();
                    if (++_loc_6 < 10)
                    {
                        _loc_5 = _loc_5 + ("0" + ++_loc_6 + "/");
                    }
                    else
                    {
                        _loc_5 = _loc_5 + (_loc_6 + "/");
                    }
                    _loc_7 = _loc_3.getFullYear().toString();
                    _loc_5 = _loc_5 + (_loc_7 + ".");
                    this.arr_time.push(_loc_5);
                    this.arr_mess.push(_loc_2.message);
					this.arr_url.push(_loc_2.url);
                    face_book_mc.datetime.text = this.arr_time[0];
                    face_book_mc.mess.text = this.arr_mess[0];
					face_book_url = this.arr_url[0];
                }
            }
            return;
        }// end function

        public function timerListener(event:TimerEvent) : void
        {
            var _loc_3:Object = this;
            var _loc_4:* = this.counter + 1;
            _loc_3.counter = _loc_4;
            if (this.counter >= 5)
            {
                this.counter = 0;
            }
            var _loc_2:* = this.sub_string(this.arr_mess[this.counter], 100);
            face_book_mc.datetime.text = this.arr_time[this.counter];
            face_book_mc.mess.text = _loc_2;
			face_book_url = this.arr_url[this.counter];
            return;
        }// end function

        public function sub_string(param1:String, param2:Number) : String
        {
            var _loc_3:* = new Array();
            var _loc_4:* = "";
            param1.split("  ").join(" ");
            _loc_3 = param1.split(" ");
            var _loc_5:Number = 0;
            while (_loc_5 < param2)
            {
                
                if (_loc_3[_loc_5])
                {
                    _loc_4 = _loc_4 + (_loc_3[_loc_5] + " ");
                }
                _loc_5 = _loc_5 + 1;
            }
            return _loc_4;
        }// end function

        function loadFaceBookData()
        {
            this.url_source = "facebook.xml";
            this.arr_time = new Array();
            this.arr_mess = new Array();
            this.loader = new URLLoader();
            this.counter = 0;
            this.myTimer = new Timer(5000);
            this.loader.load(new URLRequest(this.url_source));
            this.loader.addEventListener(Event.COMPLETE,xmlLoaded);
            this.myTimer.addEventListener(TimerEvent.TIMER,timerListener);
            this.myTimer.start();
            return;
        }// end function
	}
}